package com.hevs.samplewebapp.client.services;

import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.hevs.samplewebapp.client.bean.CompositeWRefresh;

/**
 * 
 * Interface for the medical data service.
 * @author Thomas Rouvinez
 * @Date: 23.03.2012
 */
public interface MedicalDataService {

	/**
	 * Method to ask the server to delete a medical data.
	 * @param url
	 * URL of the web service
	 * @param json
	 * Medical data in JSON format
	 */
	public void sendDELETE(String url,JSONObject json);
	
	/**
	 * Method to ask the server to add a new medical data.
	 * @param url
	 * URL of the web service 
	 * @param jsonArray
	 * Medical data in JSON format
	 */
	public void sendPOST(String url,JSONArray jsonArray);
	
	/**
	 * Method to update a medical data.
	 * @param url
	 * URL of the web service 
	 * @param jsonArray
	 * Medical data in JSON format
	 */
	public void sendPUT(String url,JSONObject json);
	
	/**
	 * Method to ask the server to retrieve a list of medical data.
	 * @param comp
	 * graphical component to refresh
	 */
	public void sendGetAllMedicalRecords(CompositeWRefresh comp);
	
	/**
	 * Method to ask the server to retriev the list of granted doctor
	 * @param comp
	 * graphical component to refresh
	 */
	public void sendGetAllDoctor(CompositeWRefresh comp);
	
	/**
	 * Method to grant access to a doctor
	 * @param url
	 * URL of the web service
	 * @param json
	 * email of the doctor in JSON format
	 */
	public void sendPOSTGrantDoctor(String url, JSONObject json);
}
